<?php
include('include/config.inc.php');
///// Select technician1 : End
if(isset($_GET['technicianId']))
{
  $technicianId = $_GET['technicianId'];
  $selectTechnician = "SELECT technicianId,firstName,lastName
                         FROM technician
                        WHERE technicianId !=".$technicianId."
                          AND userType = 'None' ";
  $selectTechnicianResult = mysql_query($selectTechnician);
  $technicianArray = array();
  $c = 0;
  while($technicianRow = mysql_fetch_array($selectTechnicianResult))
  {
  
    $technicianArray['technicianId'][$c]   = $technicianRow['technicianId'];
    $technicianArray['name'][$c] = $technicianRow['firstName']." ".$technicianRow['lastName'];
    $c++;
 
  }
}
///// Select technician1 : End
///// Select technician2 : Start
if(isset($_GET['technicianId2']))
{
	$technicianId = $_GET['technicianId'];
	$technicianId2 = $_GET['technicianId2'];
  $selectTechnician = "SELECT technicianId,firstName,lastName
                         FROM technician
                        WHERE technicianId != ".$technicianId." 
                          AND technicianId != ".$technicianId2."
                          AND userType = 'None' ";
  $selectTechnicianResult = mysql_query($selectTechnician);
  $technicianArray = array();
  $c = 0;
  while($technicianRow = mysql_fetch_array($selectTechnicianResult))
  {
  
    $technicianArray['technicianId'][$c]   = $technicianRow['technicianId'];
    $technicianArray['name'][$c] = $technicianRow['firstName']." ".$technicianRow['lastName'];
    $c++;
 
  }
}
///// Select technician2 : End
///// Select technician3 : Start
if(isset($_GET['technicianId3']))
{
  $technicianId = $_GET['technicianId'];
	$technicianId2 = $_GET['technicianId2'];
	$technicianId3 = $_GET['technicianId3'];
  $selectTechnician = "SELECT technicianId,firstName,lastName
                         FROM technician
                        WHERE technicianId != ".$technicianId." 
                          AND technicianId != ".$technicianId2."
                          AND technicianId != ".$technicianId3."
                          AND userType = 'None' ";
  $selectTechnicianResult = mysql_query($selectTechnician);
  $technicianArray = array();
  $c = 0;
  while($technicianRow = mysql_fetch_array($selectTechnicianResult))
  {
  
    $technicianArray['technicianId'][$c]   = $technicianRow['technicianId'];
    $technicianArray['name'][$c] = $technicianRow['firstName']." ".$technicianRow['lastName'];
    $c++;
 
  }
}
///// Select technician3 : End
///// Select technician4 : Start
if(isset($_GET['technicianId4']))
{
  $technicianId = $_GET['technicianId'];
	$technicianId2 = $_GET['technicianId2'];
	$technicianId3 = $_GET['technicianId3'];
	$technicianId4 = $_GET['technicianId4'];
  $selectTechnician = "SELECT technicianId,firstName,lastName
                         FROM technician
                        WHERE technicianId != ".$technicianId." 
                          AND technicianId != ".$technicianId2."
                          AND technicianId != ".$technicianId3."
                          AND technicianId != ".$technicianId4."
                          AND userType = 'None' ";
  $selectTechnicianResult = mysql_query($selectTechnician);
  $technicianArray = array();
  $c = 0;
  while($technicianRow = mysql_fetch_array($selectTechnicianResult))
  {
  
    $technicianArray['technicianId'][$c]   = $technicianRow['technicianId'];
    $technicianArray['name'][$c] = $technicianRow['firstName']." ".$technicianRow['lastName'];
    $c++;
 
  }
}
///// Select technician4 : End
include("./bottom.php");
$smarty->assign("technicianArray",$technicianArray);
$smarty->display("techAllocationAj.tpl");
?>